package com.hy.demo.controller;

import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping("/demo")
public class DemoController {

	@ApiOperation("apiDemo1")
	@RequestMapping("/hello")
	public String hello(String name) {
		return "hello " + name;
	}
	
	@ApiOperation(value="apiDemo2", notes="api例子2")
	@ApiImplicitParam(name = "name", value = "说话内容", required = true, dataType = "String", paramType="path")
	@RequestMapping(value = "/say/{name}", method = RequestMethod.POST)
	public String say(@PathVariable(value="name")String key) {
		return "say " + key;
	}
}
